<!--
 * @Author: your name
 * @Date: 2022-04-02 13:45:41
 * @LastEditTime: 2022-04-02 13:51:57
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \geyao\geyao\常见面试题实现两栏布局第三种220402.html
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>两栏布局</title>
</head>
<style>
  .outer {
    display: flex;
    height: 100px;
  }

  .left {
    width: 200px;
    height: 100%;
    background: lightcoral;
  }

  .right {
    flex: 1;
    height: 100%;
    background: lightseagreen;
  }
</style>

<body>
  <!-- 利用 flex 布局，左边元素固定宽度，右边的元素设置 flex: 1 -->
  <div class="outer">
    <div class="left">左侧</div>
    <div class="right">右侧</div>
  </div>
</body>

</html>